/**
 * URL rewrite
 */
'use strict';
import proxy from 'http-proxy-middleware';

const routeProxy = proxy([
        '/mall/list'

    ], {
    target: 'http://127.0.0.1:8000',
    changeOrigin: true,
    logLevel: 'debug',
    pathRewrite: (path) => {
        return "/index.html";
    }
});z


const serverProxy =  proxy([

    '/mall',
    '/user'
    ], {
    target: 'http://api.leqibike.com',
    changeOrigin: true,
    logLevel: 'debug',
    pathRewrite: {
        '^/': '/api/v1/'
    }
});

module.exports = {
    serverProxy: serverProxy,
    routeProxy: routeProxy
};
